<html>
<head><meta charset="utf-8"><title>array_map causing errors in ecosystem · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html">array_map causing errors in ecosystem</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="209388527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209388527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209388527">(Sep 08 2020 at 13:51)</a>:</h4>
<p>While triaging the beta crater run, I came across quite a few crates which are using <code>map</code> as a method on arrays. This is causing conflicts with the unstable <code>[T; N]::map</code> added to core in 1.47; I suspect we don't want to do anything but thought I'd at least bring it up.</p>
<p>It looks like the breakage isn't too bad -- maybe a few dozen crates -- and it's sort of in the allowed territory per official rules.</p>
<p>cc <span class="user-mention" data-user-id="125270">@scottmcm</span></p>



<a name="209399833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209399833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209399833">(Sep 08 2020 at 15:07)</a>:</h4>
<p>What do those crates define map to mean? The same thing, or something different?</p>



<a name="209399984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209399984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209399984">(Sep 08 2020 at 15:08)</a>:</h4>
<p>Usually something different</p>



<a name="209400012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209400012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209400012">(Sep 08 2020 at 15:08)</a>:</h4>
<p>e.g., <a href="https://docs.rs/pod/0.5.0/pod/trait.Pod.html#method.map">https://docs.rs/pod/0.5.0/pod/trait.Pod.html#method.map</a></p>



<a name="209400026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209400026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209400026">(Sep 08 2020 at 15:08)</a>:</h4>
<p>which is a safe transmute I think?</p>



<a name="209400097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209400097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209400097">(Sep 08 2020 at 15:09)</a>:</h4>
<p>(Or claims to be anyway, I haven't checked)</p>



<a name="209400120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209400120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209400120">(Sep 08 2020 at 15:09)</a>:</h4>
<p>I think that's the main example</p>



<a name="209400196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209400196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209400196">(Sep 08 2020 at 15:09)</a>:</h4>
<p>even if it is "the same thing" since array_map is unstable it doesn't help them much :)</p>



<a name="209414258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209414258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209414258">(Sep 08 2020 at 16:54)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> Mine is exactly the same as the unstable <code>std</code> one: <a href="https://docs.rs/arraytools/0.1.5/arraytools/trait.ArrayTools.html#method.map">https://docs.rs/arraytools/0.1.5/arraytools/trait.ArrayTools.html#method.map</a> -- I do hope to deprecate that crate in favour of the real const generic methods, though.</p>



<a name="209414743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209414743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209414743">(Sep 08 2020 at 16:58)</a>:</h4>
<p>I would still like a lang change to make this easier to disambiguate, though.  It came up here, it came up again in <code>Iterator::intersperse</code>, and more.  Old IRLO thread: <a href="https://internals.rust-lang.org/t/idea-paths-in-method-names/6834?u=scottmcm">https://internals.rust-lang.org/t/idea-paths-in-method-names/6834?u=scottmcm</a></p>



<a name="209415542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209415542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209415542">(Sep 08 2020 at 17:04)</a>:</h4>
<p>it would be nice if the compiler could automatically disambiguate to the stable (external) methods if you don't have the necessary feature enabled anyway. maybe give a future-incompat warning, then move on without it</p>



<a name="209416083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209416083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209416083">(Sep 08 2020 at 17:09)</a>:</h4>
<p>aren't we doing so already, I think this only emits a future compat lint rn</p>



<a name="209416219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209416219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209416219">(Sep 08 2020 at 17:10)</a>:</h4>
<p><a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=b72566df00a134e7170b49bed6575ef9">https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=b72566df00a134e7170b49bed6575ef9</a></p>



<a name="209416373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209416373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209416373">(Sep 08 2020 at 17:11)</a>:</h4>
<p>Oh, good!</p>



<a name="209416389"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209416389" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209416389">(Sep 08 2020 at 17:11)</a>:</h4>
<p>Then extend that to have an <code>assume-rust-version = "1.xx"</code> field in Cargo.toml and compare that against the stable version of the feature. If it predates it, then ignore the stdlib version. Mini editions <span aria-label="innocent" class="emoji emoji-1f607" role="img" title="innocent">:innocent:</span></p>



<a name="209416473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209416473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209416473">(Sep 08 2020 at 17:12)</a>:</h4>
<p>so what does the breakage look like from crater? were these <code>deny(warnings)</code>?</p>



<a name="209416540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209416540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209416540">(Sep 08 2020 at 17:12)</a>:</h4>
<p><span class="user-mention" data-user-id="116155">@Jake Goulding</span> yes please</p>



<a name="209416605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209416605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209416605">(Sep 08 2020 at 17:13)</a>:</h4>
<p>And somehow mesh that with <code>cfg(available)</code></p>



<a name="209416615"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209416615" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209416615">(Sep 08 2020 at 17:13)</a>:</h4>
<p>although sometimes I want to conditionally use new features</p>



<a name="209416630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209416630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209416630">(Sep 08 2020 at 17:13)</a>:</h4>
<p>right, <code>cfg</code> is a wrinkle</p>



<a name="209417670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209417670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209417670">(Sep 08 2020 at 17:23)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116155">Jake Goulding</span> <a href="#narrow/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem/near/209416389">said</a>:</p>
<blockquote>
<p>Then extend that to have an <code>assume-rust-version = "1.xx"</code> field in Cargo.toml and compare that against the stable version of the feature. If it predates it, then ignore the stdlib version. Mini editions <span aria-label="innocent" class="emoji emoji-1f607" role="img" title="innocent">:innocent:</span></p>
</blockquote>
<p>We've talked about having a minimum-rust-version field in <code>Cargo.toml</code> for different reasons. Not entirely sure I'd want to have that change the behavior of the compiler, though.</p>



<a name="209417828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209417828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209417828">(Sep 08 2020 at 17:24)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@lcnr</span> the <code>pod</code> failure did not give a future-compat lint, just "use of unstable library feature"<br>
<a href="https://crater-reports.s3.amazonaws.com/beta-1.47-1/beta-2020-08-29/reg/pod-0.5.0/log.txt">https://crater-reports.s3.amazonaws.com/beta-1.47-1/beta-2020-08-29/reg/pod-0.5.0/log.txt</a></p>



<a name="209417848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209417848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209417848">(Sep 08 2020 at 17:24)</a>:</h4>
<p>I wonder why that's different than your playground</p>



<a name="209418697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209418697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209418697">(Sep 08 2020 at 17:31)</a>:</h4>
<p>that's a type inference issue</p>



<a name="209418761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209418761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209418761">(Sep 08 2020 at 17:32)</a>:</h4>
<p>looks like we missed something while implemented the array lang item</p>



<a name="209418788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209418788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209418788">(Sep 08 2020 at 17:32)</a>:</h4>
<p><code>un</code> shouldn't even be an array, so idk what's going on there, will have to look</p>



<a name="209419380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209419380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209419380">(Sep 08 2020 at 17:38)</a>:</h4>
<p>wait, nm. I misread, let me look further <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="209419445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209419445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209419445">(Sep 08 2020 at 17:38)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@lcnr</span> let's file an issue to track this then since it sounds plausibly bad</p>



<a name="209419460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209419460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209419460">(Sep 08 2020 at 17:38)</a>:</h4>
<p>(even if not regression-y necessarily)</p>



<a name="209419757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209419757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209419757">(Sep 08 2020 at 17:41)</a>:</h4>
<p>ah, we prioritize <code>*un</code> over <code>&amp;*un</code> here in auto deref</p>



<a name="209419803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209419803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209419803">(Sep 08 2020 at 17:41)</a>:</h4>
<p>so at least this isn't my fault <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="209419975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209419975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209419975">(Sep 08 2020 at 17:43)</a>:</h4>
<p><a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=1c26d53fd68f9e1c7a4bf63b5bcd36ce">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=1c26d53fd68f9e1c7a4bf63b5bcd36ce</a></p>



<a name="209419997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209419997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209419997">(Sep 08 2020 at 17:43)</a>:</h4>
<div class="codehilite"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">fn</span> <span class="nf">map</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">)</span><span class="w"> </span><span class="p">{}</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="c1">// fails</span>
<span class="c1">// trait Foo { fn map(&amp;mut self) {} } // compiles</span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">[</span><span class="n">T</span><span class="p">;</span><span class="w"> </span><span class="mi">2</span><span class="p">]</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">v</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="mi">2</span><span class="k">u32</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">];</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">v</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="n">v</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="n">v</span><span class="p">.</span><span class="n">map</span><span class="p">();</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="209420085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209420085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209420085">(Sep 08 2020 at 17:43)</a>:</h4>
<p>so instead of trying to go from <code>&amp;mut [T; 2]</code> to <code>&amp;[T; 2]</code> it "just stops" at <code>[T; 2]</code> here</p>



<a name="209420231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209420231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209420231">(Sep 08 2020 at 17:45)</a>:</h4>
<p>hm that seems.. annoying</p>



<a name="209420270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209420270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209420270">(Sep 08 2020 at 17:45)</a>:</h4>
<p>makes sense though :/</p>



<a name="209420397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209420397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209420397">(Sep 08 2020 at 17:46)</a>:</h4>
<p>we might be able to improve the lint here so I do think opening an issue makes sense</p>



<a name="209420411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209420411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209420411">(Sep 08 2020 at 17:46)</a>:</h4>
<p>but I am not sure how easy this will be</p>



<a name="209422140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209422140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209422140">(Sep 08 2020 at 17:59)</a>:</h4>
<p>this happens with all unstable methods:</p>
<div class="codehilite"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">fn</span> <span class="nf">into_raw_parts</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">)</span><span class="w"> </span><span class="p">{}</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="c1">// fails</span>
<span class="c1">// trait Foo { fn into_raw_parts(&amp;mut self) {} } // compiles</span>
<span class="k">impl</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nb">Vec</span><span class="o">&lt;</span><span class="kt">u32</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">v</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">Vec</span>::<span class="n">new</span><span class="p">();</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">v</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="n">v</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="n">v</span><span class="p">.</span><span class="n">into_raw_parts</span><span class="p">();</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="209425086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209425086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209425086">(Sep 08 2020 at 18:24)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem/near/209417670">said</a>:</p>
<blockquote>
<p>We've talked about having a minimum-rust-version field in <code>Cargo.toml</code> for different reasons.</p>
</blockquote>
<p>And this wouldn't be a <em>minimum</em> either. It's more like "I wrote this code assuming the functionality available in X". It's closer to a <em>maximum</em>, but not that either.</p>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem/near/209417670">said</a>:</p>
<blockquote>
<p>Not entirely sure I'd want to have that change the behavior of the compiler, though.</p>
</blockquote>
<p>Presumably users aren't happy that the "behavior of the compiler" (really including the stdlib) changes in a new version either <span aria-label="wink" class="emoji emoji-1f609" role="img" title="wink">:wink:</span>. (note that I understand that there's a difference, but I'm focusing on behavior to the end user).</p>



<a name="209425164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209425164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209425164">(Sep 08 2020 at 18:25)</a>:</h4>
<p><code>dont-automatically-choose-implementations-introduced-after="1.XX"</code></p>



<a name="209425526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209425526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209425526">(Sep 08 2020 at 18:28)</a>:</h4>
<p>Also, my 30-second solution <em>obviously</em> also solves the whole edition-specific prelude issue. <span aria-label="wink" class="emoji emoji-1f609" role="img" title="wink">:wink:</span></p>



<a name="209425865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209425865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209425865">(Sep 08 2020 at 18:31)</a>:</h4>
<p>just make the current rust version an officially sanctioned cfg and let people sort it out ;P</p>



<a name="209425901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209425901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209425901">(Sep 08 2020 at 18:31)</a>:</h4>
<p>That's already an accepted RFC</p>



<a name="209425948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209425948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209425948">(Sep 08 2020 at 18:31)</a>:</h4>
<p>yeah but it's been stalled a while as i recall</p>



<a name="209425951"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209425951" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209425951">(Sep 08 2020 at 18:31)</a>:</h4>
<p>That doesn't seem to solve the problem of the stdlib introducing methods that people weren't expecting to call. Can you expand on how it would?</p>



<a name="209428616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209428616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209428616">(Sep 08 2020 at 18:54)</a>:</h4>
<p>Stepping back a little, I'd expect this problem to only get worse over time — more people will use Rust, the stdlib will get more features, and good names are in short supply. As const generics become more functional, we'll probably have a small mountain of issues. See the "recent" <code>array::into_iter</code> and the proposed <code>array::as_ref</code>.</p>



<a name="209441223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209441223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209441223">(Sep 08 2020 at 20:39)</a>:</h4>
<p>clamp</p>



<a name="209451816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209451816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209451816">(Sep 08 2020 at 22:26)</a>:</h4>
<p>It would at least be nice to give people an ergonomic way (still has auto-(de)ref, doesn't break chaining) to force the method to be from a particular trait so that they have a reasonable option for writing code that won't break.  (<em>cough</em> <a href="https://internals.rust-lang.org/t/idea-paths-in-method-names/6834?u=scottmcm">https://internals.rust-lang.org/t/idea-paths-in-method-names/6834?u=scottmcm</a> <em>cough</em>)</p>



<a name="209457138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209457138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209457138">(Sep 08 2020 at 23:40)</a>:</h4>
<p>"writing code that won't break" seems to imply that you'd have to use that form everywhere, no? Or would you only use that when a known change is coming down the line?</p>



<a name="209458195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209458195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209458195">(Sep 08 2020 at 23:57)</a>:</h4>
<p>that form also makes it easier to fix code that does break.</p>



<a name="209458300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209458300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209458300">(Sep 08 2020 at 23:59)</a>:</h4>
<p>I was thinking of it largely as the "oh, I got a future compat warning -- let me switch to <code>.Itertools::intersperse(",")</code> now so I'll be safe for that update"</p>



<a name="209458400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/array_map%20causing%20errors%20in%20ecosystem/near/209458400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/array_map.20causing.20errors.20in.20ecosystem.html#209458400">(Sep 09 2020 at 00:00)</a>:</h4>
<p>The versions that would could silently make things keep working are things like code depending on the order of trait <code>use</code>s, which scare me.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>